package com.schoolai.feign.system;

import com.schoolai.entity.jpa.SysMenu;
import com.schoolai.entity.jpa.SysUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * Copyright(C),2019-2025，XX公司
 * FileName:IFeignSchoolSystemController
 * Author:bobby
 * 创建时间：2025/10/15 10:15
 * Description:学校用户管理Feigh接口
 * History:
 * <auth>        <time>       <version>       <desc>
 * 作者          修改时间       版本号         描述
 */
@FeignClient(value="school-system-server", path = "/sys")
@Tag(name = "feign接口员工管理", description = "feign接口员工管理接口")
public interface IFeignSchoolSystemController {
    @Operation(summary = "feign接口通过用户名查询用户信息")
    @GetMapping("/api/feign/user/{username}")
    public SysUser loadUserByUsername(@Parameter(description = "用户名", required = true, example = "admin") @PathVariable String username);

    @Operation(summary = "Feign接口-通过用户id查询拥有权限")
    @GetMapping("/api/feign/menu/{userId}")
    public List<SysMenu> findMenuByUserId(@Parameter(description = "用户ID", required = true, example = "1") @PathVariable("userId") String userId);
}
